package com.maimang.platform.page;


import com.maimang.platform.common.utils.http.ServletUtils;
import com.maimang.platform.constant.Constants;

/**
 * @author Rocky
 * @version 1.0.0
 * @classname TableSupport
 * @description 表格数据处理
 * @date 2019-04-16 20:15
 * @email jintaozhao@qq.com
 */
public class TableSupport {

	/**
	 * 封装分页对象
	 */
	public static PageDomain getPageDomain() {
		PageDomain pageDomain = new PageDomain();
		pageDomain.setPageNum(ServletUtils.getParameterToInt(Constants.PAGE_NUM));
		pageDomain.setPageSize(ServletUtils.getParameterToInt(Constants.PAGE_SIZE));
		pageDomain.setOrderByColumn(ServletUtils.getParameter(Constants.ORDER_BY_COLUMN));
		pageDomain.setIsAsc(ServletUtils.getParameter(Constants.IS_ASC));
		return pageDomain;
	}

	public static PageDomain initPageRequest() {
		return getPageDomain();
	}
}
